package com.ph.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ph.entity.MemberInfo;
import com.ph.shopping.facade.product.service.IPhProductClassifyService;
import com.ph.shopping.facade.product.vo.PhProductClassifyVo;
import com.ph.util.SessionUtil;
/**
 * @项目：phshopping
 * @描述： 商城index页面
 * @作者： hewl
 * @创建时间：2017/3/21
 * @Copyright by hewl
 * @version 1.0.0
 */
@Controller
public class IndexController {
    /*商品类别接口*/
    @Reference(version = "1.0.0")
    private IPhProductClassifyService iPhProductClassifyService;
	/**
     * 商城首页数据加载
     * @author xkw
     * @param map
     * @return String
     * @throws Exception
     */
    @RequestMapping("/")
    public String getIndex(Map<String, Object> map,HttpServletRequest request,PhProductClassifyVo classifyVo ) throws Exception {
    	List<MemberInfo> list = new ArrayList<MemberInfo>();
    	list.add(SessionUtil.getAttribute(request)) ;
    	map.put("memberList", list);
    	classifyVo.setParentId(0L);
    	classifyVo.setDeleteFlag(1);
    	map.put("shoppingList", iPhProductClassifyService.getProductIndexList(classifyVo));
//    	map.put("shoppingList", iPhProductClassifyService.getPhProductClassifyExtendVoList(classifyVo));
        return "index";
    }
}
